﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>新闻信息管理</title>
<link href="${ctx}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet" />
<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
	
<script>
$(document).ready(function(){

		$("#names").focus();
		$("#columnForm").validate({
			 rules: { 
				names: { 
        			required: true, 
        			maxlength:10,
        			remote: "epColumnAction!checkName.action?orgName=${enterpriseColumn.names}&columnName="+$("#columnName").attr("value")+"&math="+Math.random()
    			},
            	shortName: {
                    required: true ,
			        maxlength:20
        	    },
        	    orderColumn:{
        	    	required: true ,
        	    	number:true
        	    },
        	    linkUrl:{
        	    	url:true,
        	    	maxlength:100
        	    },
        	    typeColumn:{
        	    	required: true ,
        	    	maxlength:50
        	    },
        	    frontNum:{
        	    	maxlength:20
        	    },
        	    num:
        	    {
        	    	maxlength:20
        	    },
        	    intro:
        	    {
        	    	maxlength:500
        	    }
			},messages: {
				names: {
					remote: "该栏目已存在"
				}
			},
			success: function(label) {
				label.html("&nbsp;").addClass("checked");
	        }	
		});
	});	
</script>
	</head>
	<body>
	<div class="rhead">
		<div class="rpos">当前位置: 栏目配置 - 编辑栏目信息</div>
		<div class="ropt"><input type="button" value="返回" onclick="history.back()"/></div>
		<div class="clear"></div>
	</div>
	<form action="epColumnAction!update.action" method="post" id="columnForm">
		<input type="hidden" name="enterpriseColumn.id" value="${enterpriseColumn.id}"/>
		<table  align="center" class="listTable3" width="90%">
			<tr>
				<td class="pn-flabel">父级栏目</td>
				<td>
					<select name="enterpriseColumn.father" id="columnName">
						<option value="0">总站</option>
						<c:if test="${enterpriseColumn.father!='0'}">
						<c:forEach var="subEnterpriseColumn" items="${enterpriseColumnList}">
							<option value="${subEnterpriseColumn.id}"  
							<c:if test="${subEnterpriseColumn.id == enterpriseColumn.father}">selected</c:if> >
							${subEnterpriseColumn.names}
							</option>
						</c:forEach>
						</c:if>
					</select>
					栏目的上一级,只有list类型才能有子栏目
				</td>
			</tr>
			<tr>
				<td class="pn-flabel">栏目名称</td>
				<td>
					<input type="hidden" id="nametemp" name="nametemp" value="${enterpriseColumn.names}"/>
					<input type="text" id="names" name="names" value="${enterpriseColumn.names}" size="60" />请不要重复
				</td>
			</tr>
			<tr>
				<td class="pn-flabel">栏目简称</td><td><input type="text" name="shortName" value="${enterpriseColumn.shortName}" size="60" />可自定义</td>
			</tr>
			<tr>
				<td class="pn-flabel">栏目模块名称</td><td><input type="text" name="frontNum" value="${enterpriseColumn.frontNum}" size="60" />模块名称的设置将影响到页面的显示效果,请参考开发文档</td>
			</tr>
			<tr>
				<td class="pn-flabel">栏目排序</td><td><input type="text" name="orderColumn" value="${enterpriseColumn.orderColumn}" size="60" />数字越小,排序越前,同级同栏目下请不要重复,以免影响效果</td>
			</tr>
			<tr>
				<td class="pn-flabel">模板类型</td>
				<td>
					<select name="typeColumn" onchange="reset(this)" value="${enterpriseColumn.typeColumn}">
						<option value="mostlist">模块列表模型(mostlist)</option>
						<option value="list"  <c:if test="${enterpriseColumn.typeColumn=='list'}">selected</c:if>>列表模型(list)</option>
						<option value="link" <c:if test="${enterpriseColumn.typeColumn=='link'}">selected</c:if>>单链接模型(link)</option>
						<option value="content" <c:if test="${enterpriseColumn.typeColumn=='content'}">selected</c:if>>单页模型(content)</option>
						<option value="download" <c:if test="${enterpriseColumn.typeColumn=='download'}">selected</c:if>>下载模型(download)</option>
					</select>模板类型不能修改
					<script>
						function reset(ele){
						 var oChildren = ele.childNodes;
						 var value = ele.getAttribute('value');
						 for(var i=0;i<oChildren.length;i++){
						  if(oChildren[i].tagName=='option'){
						   if(oChildren[i].value==value){
						    oChildren[i].selected = true;
						   }
						  }
						 }
						}
						</script>
					
				</td>
			</tr>
			
			<tr>
				<td class="pn-flabel">是否在主导航显示</td>
				<td>
					<select name="enterpriseColumn.isValidInNav">
						<option value="0">否</option>
						<option value="1" <c:if test="${enterpriseColumn.isValidInNav=='1'}">selected</c:if>>是</option>
					</select>
					(只有一级导航才能进行设置生效)
				</td>
			</tr>
			<tr>
				<td class="pn-flabel">链接地址</td><td><input type="text" name="linkUrl" value="${enterpriseColumn.linkUrl}" size="60" />只有栏目设置为link时,此字段才有效果</td>
			</tr>
			
			<tr>
				<td class="pn-flabel">栏目编号</td><td><input type="text" name="num" value="${enterpriseColumn.num}" size="60" />可自定义</td>
			</tr>
			<tr>
				<td class="pn-flabel">栏目介绍</td>
				<td>
					<textarea rows="10" cols="47" name="intro">${enterpriseColumn.intro}</textarea>可自定义
				</td>
			</tr>
			<tr>
				<td class="pn-flabel">状态</td>
				<td>
					<select name="enterpriseColumn.state">
						<option value="1">已启用</option>
						<option value="0" <c:if test="${enterpriseColumn.state==0}">selected</c:if> >已停用</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input type="submit" value=" 提 交 "/>
				</td>
			</tr>
		</table>
	</form>
	</body>
</html>

